this.BX=this.BX||{};this.BX.Landing=this.BX.Landing||{};(function(e,t,a){"use strict";function i(e,t){n(e,t);t.add(e)}function l(e,t,a){n(e,t);t.set(e,a)}function n(e,t){if(t.has(e)){throw new TypeError("Cannot initialize the same private elements twice on an object")}}function s(e,t,a){if(!t.has(e)){throw new TypeError("attempted to get private field on non-instance")}return a}var r=new WeakMap;var o=new WeakSet;var c=function(){function e(a){babelHelpers.classCallCheck(this,e);i(this,o);l(this,r,{writable:true,value:void 0});babelHelpers.classPrivateFieldSet(this,r,a.iframe);if(!t.Type.isDomNode(babelHelpers.classPrivateFieldGet(this,r))){throw new Error("Missed 'frame' option as iFrame Element.")}}babelHelpers.createClass(e,[{key:"onDesignerBlockClick",value:function e(t){s(this,o,d).call(this,"onDesignerBlockClick",{blockId:t})}},{key:"onStyleBlockClick",value:function e(t){s(this,o,d).call(this,"onStyleBlockClick",{blockId:t})}},{key:"onEditBlockClick",value:function e(t){s(this,o,d).call(this,"onEditBlockClick",{blockId:t})}},{key:"onSortDownBlockClick",value:function e(t){s(this,o,d).call(this,"onSortDownBlockClick",{blockId:t})}},{key:"onSortUpBlockClick",value:function e(t){s(this,o,d).call(this,"onSortUpBlockClick",{blockId:t})}},{key:"onRemoveBlockClick",value:function e(t){s(this,o,d).call(this,"onRemoveBlockClick",{blockId:t})}},{key:"onChangeStateBlockClick",value:function e(t){s(this,o,d).call(this,"onChangeStateBlockClick",{blockId:t})}},{key:"onCutBlockClick",value:function e(t){s(this,o,d).call(this,"onCutBlockClick",{blockId:t})}},{key:"onCopyBlockClick",value:function e(t){s(this,o,d).call(this,"onCopyBlockClick",{blockId:t})}},{key:"onPasteBlockClick",value:function e(t){s(this,o,d).call(this,"onPasteBlockClick",{blockId:t})}},{key:"onFeedbackClick",value:function e(t){s(this,o,d).call(this,"onFeedbackClick",{blockId:t})}},{key:"onSaveInLibraryClick",value:function e(t){s(this,o,d).call(this,"onSaveInLibraryClick",{blockId:t})}},{key:"onHideEditorPanel",value:function e(){s(this,o,d).call(this,"onHideEditorPanel")}}]);return e}();function d(e,t){babelHelpers.classPrivateFieldGet(this,r).contentWindow.postMessage({action:e,payload:t},window.location.origin)}var u=function(){function e(){babelHelpers.classCallCheck(this,e)}babelHelpers.createClass(e,null,[{key:"loadMessages",value:function t(a){e.messages=a}},{key:"getMessage",value:function t(a){return e.messages[a]}}]);return e}();var p,h,v,b,g,f,k,m,w;var C=function(){function e(){babelHelpers.classCallCheck(this,e)}babelHelpers.createClass(e,null,[{key:"setPendingMenuItemValue",value:function t(a,i,l,n){if(!e.pendingMenuItems[a]){e.pendingMenuItems[a]={}}if(!e.pendingMenuItems[a][i]){e.pendingMenuItems[a][i]={}}e.pendingMenuItems[a][i][l]=n}},{key:"getPendingMenuItemValue",value:function t(a,i,l){if(e.pendingMenuItems[a]&&e.pendingMenuItems[a][i]){return e.pendingMenuItems[a][i][l]||null}return null}},{key:"getDesignerBlockButton",value:function e(a){var i=u.getMessage("LANDING_TPL_EXT_BUTTON_DESIGNER_BLOCK");var l=t.Tag.render(p||(p=babelHelpers.taggedTemplateLiteral(['\n\t\t\t<button class="landing-ui-button landing-ui-button-action --separate','" type="button" title="','">\n\t\t\t\t<span class="landing-ui-button-text">',"</span>\n\t\t\t</button>\n\t\t"])),a?"":" landing-ui-disabled",i,i);if(a){t.Event.bind(l,"click",a)}return l}},{key:"getStyleBlockButton",value:function e(a){var i=u.getMessage("LANDING_TPL_EXT_BUTTON_STYLE_BLOCK");var l=u.getMessage("LANDING_TPL_EXT_BUTTON_STYLE_BLOCK_TITLE");var n=t.Tag.render(h||(h=babelHelpers.taggedTemplateLiteral(['\n\t\t\t<button class="landing-ui-button landing-ui-button-action --separate','" type="button" title="','">\n\t\t\t\t<span class="landing-ui-button-text">',"</span>\n\t\t\t</button>\n\t\t"])),a?"":" landing-ui-disabled",l,i);if(a){t.Event.bind(n,"click",a)}return n}},{key:"getEditBlockButton",value:function e(a){var i=u.getMessage("LANDING_TPL_EXT_BUTTON_EDIT_BLOCK");var l=u.getMessage("LANDING_TPL_EXT_BUTTON_EDIT_BLOCK_TITLE");var n=t.Tag.render(v||(v=babelHelpers.taggedTemplateLiteral(['\n\t\t\t<button class="landing-ui-button landing-ui-button-action --separate','" type="button" title="','" data-id="content">\n\t\t\t\t<span class="landing-ui-button-text">',"</span>\n\t\t\t</button>\n\t\t"])),a?"":" landing-ui-disabled",l,i);if(a){t.Event.bind(n,"click",a)}return n}},{key:"getLeftContainer",value:function a(i){return t.Tag.render(b||(b=babelHelpers.taggedTemplateLiteral(['\n\t\t\t<div class="landing-ui-external-left-container">\n\t\t\t\t<div class="landing-ui-external-left-top-hr"></div>\n\t\t\t\t<div class="landing-ui-external-body">\n\t\t\t\t\t<div class="landing-ui-external-panel">\n\t\t\t\t\t\t',"\n\t\t\t\t\t\t","\n\t\t\t\t\t\t",'\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class="landing-ui-external-left-bottom-hr"></div>\n\t\t\t</div>\n\t\t'])),e.getDesignerBlockButton(i.designerBlockClick),e.getStyleBlockButton(i.styleBlockClick),e.getEditBlockButton(i.editBlockClick))}},{key:"getSortDownBlockButton",value:function e(a){var i=u.getMessage("LANDING_TPL_EXT_BUTTON_DOWN_BLOCK");var l=t.Tag.render(g||(g=babelHelpers.taggedTemplateLiteral(['\n\t\t\t<button class="landing-ui-button landing-ui-button-action','" type="button" data-id="down" title="','"><span class="landing-ui-button-text">&nbsp;</span></button>\n\t\t'])),a?"":" landing-ui-disabled",i);if(a){t.Event.bind(l,"click",a)}return l}},{key:"getSortUpBlockButton",value:function e(a){var i=u.getMessage("LANDING_TPL_EXT_BUTTON_UP_BLOCK");var l=t.Tag.render(f||(f=babelHelpers.taggedTemplateLiteral(['\n\t\t\t<button class="landing-ui-button landing-ui-button-action','" type="button" data-id="up" title="','"><span class="landing-ui-button-text">&nbsp;</span></button>\n\t\t'])),a?"":" landing-ui-disabled",i);if(a){t.Event.bind(l,"click",a)}return l}},{key:"getBlockAdditionalMenu",value:function e(t){return a.MenuManager.getMenuById("block_actions_"+t)}},{key:"closeBlockAdditionalMenu",value:function t(a){var i=e.getBlockAdditionalMenu(a);if(i){i.close()}}},{key:"changeStateMenuItem",value:function t(a,i){var l=e.getBlockAdditionalMenu(a);var n=u.getMessage(!i?"LANDING_TPL_EXT_BUTTON_ACTIONS_SHOW":"LANDING_TPL_EXT_BUTTON_ACTIONS_HIDE");if(l){BX.Landing.Utils.setTextContent(l.getMenuItem("show_hide").getLayout()["text"],n)}else{e.setPendingMenuItemValue(a,"show_hide","state",i)}}},{key:"changePasteMenuItem",value:function t(a,i){var l=e.getBlockAdditionalMenu(a);if(l){var n=l.getMenuItem("paste");if(n){if(i){n.enable()}else{n.disable()}}}else{e.setPendingMenuItemValue(a,"paste","disabled",!i)}}},{key:"getActionsList",value:function i(l,n){var s=u.getMessage("LANDING_TPL_EXT_BUTTON_ACTIONS_BLOCK");var r=u.getMessage("LANDING_TPL_EXT_BUTTON_ACTIONS_BLOCK_TITLE");var o=t.Tag.render(k||(k=babelHelpers.taggedTemplateLiteral(['\n\t\t\t<button class="landing-ui-button landing-ui-button-action" type="button" data-id="actions" title="','">\n\t\t\t\t<span class="landing-ui-button-text">',"</span>\n\t\t\t</button>\n\t\t"])),r,s);t.Event.bind(o,"click",(function(t){if(n.onOpenAdditionalMenu){n.onOpenAdditionalMenu(l);t.stopPropagation()}var i=e.getBlockAdditionalMenu(l);if(i){i.show();return}a.MenuManager.create({id:"block_actions_"+l,bindElement:o,className:"landing-ui-block-actions-popup",angle:{position:"top",offset:95},offsetTop:-6,offsetLeft:-26,items:[new a.MenuItem({id:"show_hide",disabled:!n.changeStateClick,text:u.getMessage(n.state||e.getPendingMenuItemValue(l,"show_hide","state")?"LANDING_TPL_EXT_BUTTON_ACTIONS_HIDE":"LANDING_TPL_EXT_BUTTON_ACTIONS_SHOW"),onclick:function e(){n.changeStateClick()}}),new a.MenuItem({id:"cut",disabled:!n.cutClick,text:u.getMessage("LANDING_TPL_EXT_BUTTON_ACTIONS_CUT"),onclick:function e(){n.cutClick()}}),new a.MenuItem({id:"copy",disabled:!n.copyClick,text:u.getMessage("LANDING_TPL_EXT_BUTTON_ACTIONS_COPY"),onclick:function e(){n.copyClick()}}),new a.MenuItem({id:"paste",disabled:!n.pasteClick||e.getPendingMenuItemValue(l,"paste","disabled"),text:u.getMessage("LANDING_TPL_EXT_BUTTON_ACTIONS_PASTE"),onclick:function e(){n.pasteClick()}}),new a.MenuItem({id:"feedback",disabled:!n.feedbackClick,text:u.getMessage("LANDING_TPL_EXT_BUTTON_ACTIONS_FEEDBACK"),onclick:function e(){n.feedbackClick()}}),n.saveInLibrary?new a.MenuItem({delimiter:true}):null,new a.MenuItem({id:"save_in_library",disabled:!n.saveInLibrary,text:u.getMessage("LANDING_TPL_EXT_BUTTON_ACTIONS_SAVE_IN_LIBRARY"),onclick:function e(){n.saveInLibrary()}})]}).show()}));return o}},{key:"getRemoveBlockButton",value:function e(a){var i=u.getMessage("LANDING_TPL_EXT_BUTTON_REMOVE_BLOCK");var l=t.Tag.render(m||(m=babelHelpers.taggedTemplateLiteral(['\n\t\t\t<button class="landing-ui-button landing-ui-button-action','" type="button" data-id="remove" title="','"><span class="landing-ui-button-text">&nbsp;</span></button>\n\t\t'])),a?"":" landing-ui-disabled",i);if(a){t.Event.bind(l,"click",a)}return l}},{key:"getRightContainer",value:function a(i){return t.Tag.render(w||(w=babelHelpers.taggedTemplateLiteral(['\n\t\t\t<div class="landing-ui-external-right-container">\n\t\t\t\t<div class="landing-ui-external-right-top-hr"></div>\n\t\t\t\t<div class="landing-ui-external-body">\n\t\t\t\t\t<div class="landing-ui-external-panel">\n\t\t\t\t\t\t',"\n\t\t\t\t\t\t","\n\t\t\t\t\t\t","\n\t\t\t\t\t\t",'\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class="landing-ui-external-right-bottom-hr"></div>\n\t\t\t</div>\n\t\t'])),e.getSortDownBlockButton(i.sortDownBlockClick),e.getSortUpBlockButton(i.sortUpBlockClick),e.getActionsList(i.blockId,i),e.getRemoveBlockButton(i.removeBlockClick))}}]);return e}();babelHelpers.defineProperty(C,"pendingMenuItems",{});function P(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,i)}return a}function y(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?P(Object(a),!0).forEach((function(t){babelHelpers.defineProperty(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):P(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}function T(e,t){B(e,t);t.add(e)}function H(e,t,a){B(e,t);t.set(e,a)}function B(e,t){if(t.has(e)){throw new TypeError("Cannot initialize the same private elements twice on an object")}}function S(e,t,a){if(!t.has(e)){throw new TypeError("attempted to get private field on non-instance")}return a}var I=new WeakMap;var _=new WeakMap;var L=new WeakMap;var M=new WeakMap;var G=new WeakMap;var N=new WeakMap;var F=new WeakSet;var E=new WeakSet;var D=new WeakSet;var O=new WeakSet;var x=new WeakSet;var W=new WeakSet;var A=new WeakSet;var U=new WeakSet;var X=new WeakSet;var R=new WeakSet;var j=function e(a){var i=this;babelHelpers.classCallCheck(this,e);T(this,R);T(this,X);T(this,U);T(this,A);T(this,W);T(this,x);T(this,O);T(this,D);T(this,E);T(this,F);H(this,I,{writable:true,value:void 0});H(this,_,{writable:true,value:void 0});H(this,L,{writable:true,value:void 0});H(this,M,{writable:true,value:void 0});H(this,G,{writable:true,value:void 0});H(this,N,{writable:true,value:void 0});a=a||{};babelHelpers.classPrivateFieldSet(this,L,a.container);babelHelpers.classPrivateFieldSet(this,M,a.iframeWrapper);if(!t.Type.isDomNode(babelHelpers.classPrivateFieldGet(this,L))){throw new Error("Missed 'container' option as Dom Node.")}if(!t.Type.isDomNode(babelHelpers.classPrivateFieldGet(this,M))){throw new Error("Missed 'iframe' option as Dom Node.")}babelHelpers.classPrivateFieldSet(this,_,new Map);babelHelpers.classPrivateFieldSet(this,I,new c({iframe:babelHelpers.classPrivateFieldGet(this,M).querySelector("iframe")}));u.loadMessages(a.messages);window.addEventListener("message",S(this,F,V).bind(this));babelHelpers.classPrivateFieldGet(this,L).addEventListener("click",(function(e){babelHelpers.classPrivateFieldGet(i,I).onHideEditorPanel()}));window.addEventListener("storage",S(this,E,q).bind(this))};function V(e){var t=e.data||{};if(!t.payload){return}if(t.action==="register"){S(this,D,K).call(this,t.payload.blocks)}else if(t.action==="showcontrols"){S(this,U,Z).call(this,t.payload.blockId,t.payload.top,t.payload.height)}else if(t.action==="changestate"){S(this,W,J).call(this,t.payload.blockId,t.payload.state)}else if(t.action==="mode"){S(this,R,ee).call(this,t.payload)}else if(t.action==="hideall"){S(this,A,Q).call(this)}else if(t.action==="showblockcontrols"){S(this,A,Q).call(this);S(this,X,$).call(this,t.payload.blockId)}}function q(){var e=babelHelpers.classPrivateFieldGet(this,_).values();var t=!!window.localStorage.getItem("landingBlockId");for(var a=0,i=babelHelpers.classPrivateFieldGet(this,_).size;a<i;a++){var l=e.next().value;C.changePasteMenuItem(l.id,t);S(this,x,Y).call(this,l.id,y(y({},l),{},{permissions:y(y({},l.permissions),{},{allowPaste:t})}))}}function K(e){var a=this;e.map((function(e){var i=e.id;e.leftContainer=C.getLeftContainer({designerBlockClick:e.permissions.allowDesignBlock?function(){babelHelpers.classPrivateFieldGet(a,I).onDesignerBlockClick(i)}:null,styleBlockClick:e.permissions.allowModifyStyles?function(){babelHelpers.classPrivateFieldGet(a,I).onStyleBlockClick(i)}:null,editBlockClick:e.permissions.allowEditContent?function(){babelHelpers.classPrivateFieldGet(a,I).onEditBlockClick(i)}:null});e.rightContainer=C.getRightContainer({blockId:i,state:e.state,sortDownBlockClick:e.permissions.allowSorting?function(){babelHelpers.classPrivateFieldGet(a,I).onSortDownBlockClick(i);S(a,A,Q).call(a)}:null,sortUpBlockClick:e.permissions.allowSorting?function(){babelHelpers.classPrivateFieldGet(a,I).onSortUpBlockClick(i);S(a,A,Q).call(a)}:null,removeBlockClick:e.permissions.allowRemove?function(){babelHelpers.classPrivateFieldGet(a,I).onRemoveBlockClick(i);S(a,A,Q).call(a)}:null,onOpenAdditionalMenu:function e(t){babelHelpers.classPrivateFieldSet(a,N,t);setTimeout((function(){babelHelpers.classPrivateFieldGet(a,I).onHideEditorPanel()}),0)},changeStateClick:e.permissions.allowChangeState?function(){C.closeBlockAdditionalMenu(i);babelHelpers.classPrivateFieldGet(a,I).onChangeStateBlockClick(i);S(a,X,$).call(a,i)}:null,cutClick:e.permissions.allowRemove?function(){babelHelpers.classPrivateFieldGet(a,I).onCutBlockClick(i);S(a,A,Q).call(a)}:null,copyClick:function e(){C.closeBlockAdditionalMenu(i);babelHelpers.classPrivateFieldGet(a,I).onCopyBlockClick(i);S(a,X,$).call(a,i)},pasteClick:e.permissions.allowPaste?function(){C.closeBlockAdditionalMenu(i);babelHelpers.classPrivateFieldGet(a,I).onPasteBlockClick(i);S(a,X,$).call(a,i)}:null,feedbackClick:function e(){C.closeBlockAdditionalMenu(i);babelHelpers.classPrivateFieldGet(a,I).onFeedbackClick(i)},saveInLibrary:e.permissions.allowSaveInLibrary?function(){C.closeBlockAdditionalMenu(i);babelHelpers.classPrivateFieldGet(a,I).onSaveInLibraryClick(i)}:null});t.Dom.append(e.leftContainer,babelHelpers.classPrivateFieldGet(a,L));t.Dom.append(e.rightContainer,babelHelpers.classPrivateFieldGet(a,L));t.Dom.hide(e.leftContainer);t.Dom.hide(e.rightContainer);babelHelpers.classPrivateFieldGet(a,_).set(i,e)}))}function z(e){return babelHelpers.classPrivateFieldGet(this,_).get(parseInt(e))}function Y(e,t){babelHelpers.classPrivateFieldGet(this,_).set(parseInt(e),t)}function J(e,t){var a=S(this,O,z).call(this,e);if(a){C.changeStateMenuItem(e,t);S(this,x,Y).call(this,e,y(y({},a),{},{state:t}))}}function Q(){if(babelHelpers.classPrivateFieldGet(this,G)){var e=babelHelpers.classPrivateFieldGet(this,_).get(babelHelpers.classPrivateFieldGet(this,G));t.Dom.hide(e.leftContainer);t.Dom.hide(e.rightContainer)}else{var a=babelHelpers.classPrivateFieldGet(this,_).values();for(var i=0,l=babelHelpers.classPrivateFieldGet(this,_).size;i<l;i++){var n=a.next().value;t.Dom.hide(n.leftContainer);t.Dom.hide(n.rightContainer)}}if(babelHelpers.classPrivateFieldGet(this,N)){C.closeBlockAdditionalMenu(babelHelpers.classPrivateFieldGet(this,N));babelHelpers.classPrivateFieldSet(this,N,null)}}function Z(e,a,i){var l=S(this,O,z).call(this,e);if(!l){return}var n=babelHelpers.classPrivateFieldGet(this,M).getBoundingClientRect();S(this,A,Q).call(this);babelHelpers.classPrivateFieldSet(this,G,l.id);babelHelpers.classPrivateFieldGet(this,I).onHideEditorPanel();a=parseInt(a);if(a<0&&i+a>50){i=i+a;a=0;t.Dom.addClass(l.leftContainer,"hide-top");t.Dom.addClass(l.rightContainer,"hide-top")}else{t.Dom.removeClass(l.leftContainer,"hide-top");t.Dom.removeClass(l.rightContainer,"hide-top")}t.Dom.show(l.leftContainer);t.Dom.show(l.rightContainer);l.leftContainer.style.width=n.left+"px";l.leftContainer.style.top=a+"px";l.leftContainer.style.height=i+"px";l.rightContainer.style.width=n.left+"px";l.rightContainer.style.left=n.left+n.width+"px";l.rightContainer.style.top=a+"px";l.rightContainer.style.height=i+"px"}function $(e){var a=this;var i=S(this,O,z).call(this,e);if(i){babelHelpers.classPrivateFieldSet(this,G,null);t.Dom.hide(i.leftContainer);t.Dom.hide(i.rightContainer);setTimeout((function(){babelHelpers.classPrivateFieldSet(a,G,i.id);t.Dom.show(i.leftContainer);t.Dom.show(i.rightContainer)}),500)}}function ee(e){if(e.type==="internal"){S(this,A,Q).call(this)}}var te={defaultDevice:{tablet:"iphone14pro",mobile:"iphone14pro"},devices:{delimiter1:{code:"delimiter",langCode:"LANDING_PREVIEW_DEVICE_MOBILES"},iphone14pro:{name:"iPhone 14 Pro",code:"iphone14pro",className:"--iphone-14-pro",width:393,height:852},iPhoneXR:{name:"iPhone XR",code:"iPhoneXR",className:"--iphone-xr",width:414,height:896},iPhoneSE:{name:"iPhone SE",code:"iPhoneSE",className:"--iphone-se",width:375,height:667},SamsungGalaxyNote10:{name:"Samsung Galaxy Note10",code:"SamsungGalaxyNote10",className:"--samsung-galaxy-note10",width:412,height:896},SamsungGalaxyS8:{name:"Samsung Galaxy S8+",code:"SamsungGalaxyS8",className:"--samsung-galaxy-s8-plus",width:360,height:740},GooglePixel4:{name:"Google Pixel 4",code:"GooglePixel4",className:"--google-pixel-4",width:353,height:745},delimiter2:{code:"delimiter",langCode:"LANDING_PREVIEW_DEVICE_TABLETS"},iPad:{name:"iPad",code:"iPad",className:"--ipad",width:810,height:1080},iPadMini:{name:"iPad Mini",code:"iPadMini",className:"--ipad-mini",width:744,height:1133},SamsungGalaxyTabS8:{name:"Samsung Galaxy Tab S8",code:"SamsungGalaxyTabS8",className:"--samsung-galaxy-tab-s8",width:800,height:1280}}};var ae,ie,le,ne,se;var re=function(){function e(){babelHelpers.classCallCheck(this,e)}babelHelpers.createClass(e,null,[{key:"getPreview",value:function a(i){if(i.messages){e.messages=i.messages}if(!localStorage.getItem("deviceOrientation")){localStorage.setItem("deviceOrientation","portrait")}var l=function e(a){localStorage.setItem("deviceHidden",!t.Dom.hasClass(r.switcher,"landing-switcher-hide"));t.Dom.toggleClass(r.switcher,"landing-switcher-hide");t.Dom.toggleClass(r.wrapper,"landing-device-wrapper-hidden")};var n=function e(t){if(localStorage.getItem("deviceOrientation")==="portrait"){localStorage.setItem("deviceOrientation","landscape")}else{localStorage.setItem("deviceOrientation","portrait")}r.wrapper.style.setProperty("width","".concat(r.wrapper.offsetHeight,"px"));r.wrapper.style.setProperty("height","".concat(r.wrapper.offsetWidth,"px"));r.frame.style.setProperty("width","".concat(r.frame.offsetHeight,"px"));r.frame.style.setProperty("height","".concat(r.frame.offsetWidth,"px"));r.wrapper.querySelector('[data-role="device-orientation"]').innerHTML=localStorage.getItem("deviceOrientation")};var s=localStorage.getItem("deviceHidden")==="true";var r={wrapper:t.Tag.render(ae||(ae=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<div class="landing-device-wrapper','">\n\t\t\t\t\t<div class="landing-device-name" onclick="','">\n\t\t\t\t\t\t<span data-role="device-name">Device</span>\n\t\t\t\t\t\t<span data-role="device-orientation" class="landing-device-orientation">Orientation</span>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t'])),s?" landing-device-wrapper-hidden":"",i.clickHandler),switcher:t.Tag.render(ie||(ie=babelHelpers.taggedTemplateLiteral(['<div class="landing-device-switcher','" onclick="','" data-role="landing-device-switcher"></div>'])),s?" landing-switcher-hide":"",l),rotate:t.Tag.render(le||(le=babelHelpers.taggedTemplateLiteral(['<div class="landing-device-rotate" onclick="','" data-role="landing-device-rotate"></div>'])),n),frame:t.Tag.render(ne||(ne=babelHelpers.taggedTemplateLiteral(['<iframe data-role="landing-device-preview-iframe" src="','"></iframe>'])),i.frameUrl),frameWrapper:t.Tag.render(se||(se=babelHelpers.taggedTemplateLiteral(['<div class="landing-device-preview" data-role="landing-device-preview"></div>'])))};r.wrapper.appendChild(r.switcher);r.wrapper.appendChild(r.rotate);r.wrapper.appendChild(r.frameWrapper);r.frameWrapper.appendChild(r.frame);return r.wrapper}},{key:"openDeviceMenu",value:function t(i,l,n){var s="device_selector";var r=a.MenuManager.getMenuById(s);if(r){r.show();return}var o=[];l.map((function(t){if(t.code==="delimiter"){o.push(new a.MenuItem({delimiter:true,text:t.langCode?e.messages[t.langCode]:""}));return}o.push(new a.MenuItem({id:t.className,html:"".concat(t.name),onclick:function e(){a.MenuManager.getMenuById(s).close();n(t)}}))}));if(i){i=i.parentNode}r=a.MenuManager.create({id:s,bindElement:i,className:"landing-ui-block-actions-popup",items:o,angle:true,offsetTop:0,offsetLeft:40,minWidth:i.offsetWidth,animation:"fading-slide"});r.show()}}]);return e}();function oe(e,t){de(e,t);t.add(e)}function ce(e,t,a){de(e,t);t.set(e,a)}function de(e,t){if(t.has(e)){throw new TypeError("Cannot initialize the same private elements twice on an object")}}function ue(e,t,a){if(!t.has(e)){throw new TypeError("attempted to get private field on non-instance")}return a}var pe=new WeakMap;var he=new WeakMap;var ve=new WeakMap;var be=new WeakMap;var ge=new WeakMap;var fe=new WeakMap;var ke=new WeakMap;var me=new WeakMap;var we=new WeakSet;var Ce=new WeakSet;var Pe=new WeakSet;var ye=new WeakSet;var Te=new WeakSet;var He=new WeakSet;var Be=new WeakSet;var Se=new WeakSet;var Ie=new WeakSet;var _e=new WeakSet;var Le=new WeakSet;var Me=function e(t){babelHelpers.classCallCheck(this,e);oe(this,Le);oe(this,_e);oe(this,Ie);oe(this,Se);oe(this,Be);oe(this,He);oe(this,Te);oe(this,ye);oe(this,Pe);oe(this,Ce);oe(this,we);ce(this,pe,{writable:true,value:void 0});ce(this,he,{writable:true,value:void 0});ce(this,ve,{writable:true,value:void 0});ce(this,be,{writable:true,value:void 0});ce(this,ge,{writable:true,value:null});ce(this,fe,{writable:true,value:false});ce(this,ke,{writable:true,value:false});ce(this,me,{writable:true,value:["Landing::upBlock","Landing::downBlock","Landing::showBlock","Landing::hideBlock","Landing::markDeletedBlock","Landing::addBlock","Landing::copyBlock","Landing::moveBlock","Block::changeNodeName","Block::updateContent","Block::getContent","Landing\\Block::addCard","Landing\\Block::cloneCard","Landing\\Block::removeCard","Landing\\Block::updateNodes","Landing\\Block::updateStyles","Landing\\Block::saveForm"]});babelHelpers.classPrivateFieldSet(this,pe,t.frameUrl);babelHelpers.classPrivateFieldSet(this,he,t.editorFrameWrapper);ue(this,we,Ge).call(this,t);ue(this,Se,We).call(this,t);ue(this,_e,Ue).call(this);ue(this,He,Oe).call(this,ue(this,Te,De).call(this,"mobile"))};function Ge(e){var t=this;BX.addCustomEvent("BX.Landing.Main:editorSizeChange",(function(e){ue(t,He,Oe).call(t,ue(t,Te,De).call(t,e))}));window.addEventListener("message",(function(e){var a=e.data||{};if(a.action==="editorenable"){if(!!a.payload.enable){babelHelpers.classPrivateFieldSet(t,fe,true)}else{if(babelHelpers.classPrivateFieldGet(t,ke)){ue(t,Pe,Fe).call(t)}babelHelpers.classPrivateFieldSet(t,fe,false);babelHelpers.classPrivateFieldSet(t,ke,false)}}else if(a.action==="backendaction"){ue(t,Ce,Ne).call(t,a.payload)}}))}function Ne(e){if(babelHelpers.classPrivateFieldGet(this,me).includes(e.action)){if(babelHelpers.classPrivateFieldGet(this,fe)){babelHelpers.classPrivateFieldSet(this,ke,true)}else{var t,a,i,l;var n=null;if((t=e.data)!==null&&t!==void 0&&t.block){var s;n=(s=e.data)===null||s===void 0?void 0:s.block}if((a=e.data)!==null&&a!==void 0&&(i=a.updateNodes)!==null&&i!==void 0&&(l=i.data)!==null&&l!==void 0&&l.block){var r,o,c;n=(r=e.data)===null||r===void 0?void 0:(o=r.updateNodes)===null||o===void 0?void 0:(c=o.data)===null||c===void 0?void 0:c.block}ue(this,Pe,Fe).call(this,n)}}}function Fe(e){if(babelHelpers.classPrivateFieldGet(this,be)){var t="editor";var a=Date.now();babelHelpers.classPrivateFieldGet(this,be).location.href=babelHelpers.classPrivateFieldGet(this,pe)+"?ts="+a+"&scrollTo="+t+e}}function Ee(e){if(babelHelpers.classPrivateFieldGet(this,be)){var t=babelHelpers.classPrivateFieldGet(this,be).document;var a=Math.max(t.body.scrollHeight,t.documentElement.scrollHeight,t.body.offsetHeight,t.documentElement.offsetHeight,t.body.clientHeight,t.documentElement.clientHeight);babelHelpers.classPrivateFieldGet(this,be).scroll(0,a*e/100)}}function De(e){var t;var a=localStorage.getItem("deviceCode");if(a&&te.devices[a]){return te.devices[a]}a=(t=te.defaultDevice)===null||t===void 0?void 0:t[e];if(!a){return}return te.devices[a]}function Oe(e){if(!e){return}localStorage.setItem("deviceCode",e.code);if(babelHelpers.classPrivateFieldGet(this,ge)){t.Dom.removeClass(babelHelpers.classPrivateFieldGet(this,ve),babelHelpers.classPrivateFieldGet(this,ge).className);babelHelpers.classPrivateFieldGet(this,ve).style.removeProperty("top")}babelHelpers.classPrivateFieldSet(this,ge,e);babelHelpers.classPrivateFieldGet(this,ve).querySelector('[data-role="device-name"]').innerHTML=e.name;babelHelpers.classPrivateFieldGet(this,ve).querySelector('[data-role="device-orientation"]').innerHTML=localStorage.getItem("deviceOrientation");var a=babelHelpers.classPrivateFieldGet(this,ve).querySelector('[data-role="landing-device-preview-iframe"]');var i=babelHelpers.classPrivateFieldGet(this,ve).querySelector('[data-role="landing-device-preview"]');if(a&&i&&babelHelpers.classPrivateFieldGet(this,ge).width&&babelHelpers.classPrivateFieldGet(this,ge).height){var l=window.innerHeight/(babelHelpers.classPrivateFieldGet(this,ge).height+300);var n=parseInt(window.getComputedStyle(i).padding);var s=babelHelpers.classPrivateFieldGet(this,ge).width;var r=babelHelpers.classPrivateFieldGet(this,ge).height;if(localStorage.getItem("deviceOrientation")==="landscape"){s=babelHelpers.classPrivateFieldGet(this,ge).height;r=babelHelpers.classPrivateFieldGet(this,ge).width}a.style.setProperty("width","".concat(s,"px"));a.style.setProperty("height","".concat(r,"px"));i.style.setProperty("transform","scale(".concat(l,")"));babelHelpers.classPrivateFieldGet(this,ve).style.setProperty("width","".concat((s+n*2)*l,"px"));babelHelpers.classPrivateFieldGet(this,ve).style.setProperty("height","".concat((r+n*2)*l,"px"))}t.Dom.addClass(babelHelpers.classPrivateFieldGet(this,ve),babelHelpers.classPrivateFieldGet(this,ge).className)}function xe(){var e=babelHelpers.classPrivateFieldGet(this,he).querySelector("iframe").contentWindow.document;var t=Math.max(e.body.scrollHeight,e.documentElement.scrollHeight,e.body.offsetHeight,e.documentElement.offsetHeight,e.body.clientHeight,e.documentElement.clientHeight);var a=e.documentElement.scrollTop||e.body.scrollTop;ue(this,ye,Ee).call(this,a/t*100)}function We(e){if(!babelHelpers.classPrivateFieldGet(this,ve)){babelHelpers.classPrivateFieldSet(this,ve,re.getPreview({frameUrl:e.frameUrl,clickHandler:ue(this,Ie,Ae).bind(this),messages:e.messages}));t.Dom.hide(babelHelpers.classPrivateFieldGet(this,ve));document.body.appendChild(babelHelpers.classPrivateFieldGet(this,ve));if(!babelHelpers.classPrivateFieldGet(this,be)){babelHelpers.classPrivateFieldSet(this,be,babelHelpers.classPrivateFieldGet(this,ve).querySelector("iframe").contentWindow);var a=babelHelpers.classPrivateFieldGet(this,ve).querySelector("iframe").contentWindow.document;t.Dom.removeClass(a.querySelector("html"),"bx-no-touch");t.Dom.addClass(a.querySelector("html"),"bx-touch")}ue(this,Be,xe).call(this)}}function Ae(){re.openDeviceMenu(babelHelpers.classPrivateFieldGet(this,ve).querySelector('[data-role="device-name"]'),Object.values(te.devices),ue(this,He,Oe).bind(this))}function Ue(){t.Dom.show(babelHelpers.classPrivateFieldGet(this,ve))}e.ExternalControls=j;e.Device=Me})(this.BX.Landing.View=this.BX.Landing.View||{},BX,BX.Main);
//# sourceMappingURL=script.map.js